import request from '@/utils/request'

// 查询人员管理列表
export function listEmployees(query) {
  return request({
    url: '/service/employees/list',
    method: 'get',
    params: query
  })
}

// 查询人员管理详细
export function getEmployees(id) {
  return request({
    url: '/service/employees/' + id,
    method: 'get'
  })
}

// 新增人员管理
export function addEmployees(data) {
  return request({
    url: '/service/employees',
    method: 'post',
    data: data
  })
}

// 修改人员管理
export function updateEmployees(data) {
  return request({
    url: '/service/employees',
    method: 'put',
    data: data
  })
}

// 删除人员管理
export function delEmployees(id) {
  return request({
    url: '/service/employees/' + id,
    method: 'delete'
  })
}

// 根据人员id修改pda密码
export function updateEmployeesPdaPwd(id, oldPassword, newPassword) {
  const data = {
    id,
    oldPassword,
    newPassword
  }
  return request({
    url: '/service/employees/changePadPwd',
    method: 'put',
    data: data
  })
}

// 根据人员id修改pda密码
export function resetEmployeesPdaPwdPwd(id) {
  return request({
    url: '/service/employees/resetPadPwd/' + id,
    method: 'put'
  })
}

// 导入人员信息
export function importEmployees(data) {
  return request({
    url: '/service/employees/import',
    method: 'post',
    data: data
  })
}

// 导入模版
export function exportEmployeesTemplate() {
  return request({
    url: '/service/employees/exportTemplate',
    method: 'get',
    responseType: 'blob'
  })
}